Gear Rotation Puzzle Solution